package jsyf.oa.service.business;

import com.alibaba.fastjson.JSONObject;
import jsyf.com.util.FastJsonConvert;
import jsyf.oa.dao.business.BusinessMainDao;
import jsyf.oa.dao.business.BusinessMatterDao;
import jsyf.oa.entity.device.DeviceBrandEntity;
import jsyf.oa.facade.business.BusinessMatterFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by 92852 on 2018/3/30.
 */

@Service
@Transactional(rollbackFor = Exception.class)
@com.alibaba.dubbo.config.annotation.Service(protocol = {"dubbo"})
public class BusinessMatterService implements BusinessMatterFacade {
    @Autowired
    private BusinessMatterDao businessMatterDao;

    @Override
    public List<JSONObject> getBusinessMatterList() {
       // JSONObject jsonParams = FastJsonConvert.convertJSONToObject(jsonData, JSONObject.class);
        JSONObject obj = new JSONObject();
        StringBuffer condition = new StringBuffer();
        condition.append("SELECT");
        condition.append(" T_BUSINESS_MATTER.ID AS id,");
        condition.append(" T_BUSINESS_MATTER.NAME AS name");
        condition.append(" FROM T_BUSINESS_MATTER");
        List<JSONObject> records = businessMatterDao.queryForJsonList(condition.toString(), new Object[]{});

        return records;

    }


}
